package zzs.generalframework.coder.core.encoder.temp.console.service;

import zzs.generalframework.coder.common.model.ClazzBO;

/**
 * @title
 * @description
 * @project zzs-coder
 * @package zzs.generalframework.coder.core.encoder.temp.console.service
 * @author zzs
 * @date 2018年1月31日
 * @version 1.0
 */
public class InterfaceCoder
{

	public String createFile(ClazzBO clazzBO)
	{
		StringBuffer returnBuffer = new StringBuffer();

		if (clazzBO.getPackageName() != null)
		{
			// returnBuffer.append("package
			// ").append(clazzBO.getPackageName()).append(";").append("\n").append("\n");
		}

		if (clazzBO.getImportList() != null && clazzBO.getImportList().size() > 0)
		{
			for (String itemImport : clazzBO.getImportList())
			{
				// returnBuffer.append("import
				// ").append(itemImport).append(";").append("\n");
			}
		}

		returnBuffer.append("\n");

		// returnBuffer.append("public interface
		// ").append(clazzBO.getClassName()).append("\n");
		// returnBuffer.append("{").append("\n");

		/**
		 * 保存政治面貌信息
		 * 
		 * @param politicalStatusBO
		 * @return
		 */
		// public ConsoleReturnBO insertPoliticalStatus(PoliticalStatusBO
		// politicalStatusBO);

		returnBuffer.append("/**").append("\n");
		returnBuffer.append("* 保存").append(clazzBO.getEntityName()).append("信息").append("\n");
		returnBuffer.append("*").append("\n");
		returnBuffer.append("* @param ").append(clazzBO.getEntityCodeCamal()).append("\n");
		returnBuffer.append("* @return").append("\n");
		returnBuffer.append("*/").append("\n");
		returnBuffer.append("public ConsoleReturnBO save").append(clazzBO.getEntityCode()).append("(").append(clazzBO.getEntityCode()).append("BO ").append(clazzBO.getEntityCodeCamal()).append("BO);").append("\n");

		/**
		 * 保存政治面貌信息列表
		 * 
		 * @param politicalStatusBOList
		 * @return
		 * @throws ConsoleRollBackException
		 */
		// public ConsoleReturnBO insertPoliticalStatus(List<PoliticalStatusBO>
		// politicalStatusBOList) throws ConsoleRollBackException;

		returnBuffer.append("/**").append("\n");
		returnBuffer.append("* 保存").append(clazzBO.getEntityName()).append("信息列表").append("\n");
		returnBuffer.append("*").append("\n");
		returnBuffer.append("* @param ").append(clazzBO.getEntityCodeCamal()).append("BOList").append("\n");
		returnBuffer.append("* @return").append("\n");
		returnBuffer.append("* @throws ConsoleException").append("\n");
		returnBuffer.append("*/").append("\n");
		returnBuffer.append("public ConsoleReturnBO save").append(clazzBO.getEntityCode()).append("(List<").append(clazzBO.getEntityCode()).append("BO> ").append(clazzBO.getEntityCodeCamal()).append("BOList) throws ConsoleException;").append("\n");

		/**
		 * 获取政治面貌信息
		 * 
		 * @param politicalStatusInfo
		 * @return
		 */
		// public ConsoleReturnBO getPoliticalStatus(PoliticalStatusInfo
		// politicalStatusInfo);

		returnBuffer.append("/**").append("\n");
		returnBuffer.append("* 获取").append(clazzBO.getEntityName()).append("信息").append("\n");
		returnBuffer.append("*").append("\n");
		returnBuffer.append("* @param ").append(clazzBO.getEntityCodeCamal()).append("Info").append("\n");
		returnBuffer.append("* @return").append("\n");
		returnBuffer.append("*/").append("\n");
		returnBuffer.append("public ConsoleReturnBO get").append(clazzBO.getEntityCode()).append("(").append(clazzBO.getEntityCode()).append("Info ").append(clazzBO.getEntityCodeCamal()).append("Info);").append("\n");

		/**
		 * 获取政治面貌信息
		 * 
		 * @param politicalStatusInfo
		 * @return
		 */
		// public ConsoleReturnBO listPoliticalStatus(PoliticalStatusInfo
		// politicalStatusInfo);

		returnBuffer.append("/**").append("\n");
		returnBuffer.append("* 获取").append(clazzBO.getEntityName()).append("信息列表").append("\n");
		returnBuffer.append("*").append("\n");
		returnBuffer.append("* @param ").append(clazzBO.getEntityCodeCamal()).append("Info").append("\n");
		returnBuffer.append("* @return").append("\n");
		returnBuffer.append("*/").append("\n");
		returnBuffer.append("public ConsoleReturnBO list").append(clazzBO.getEntityCode()).append("(").append(clazzBO.getEntityCode()).append("Info ").append(clazzBO.getEntityCodeCamal()).append("Info);").append("\n");

		/**
		 * 更新政治面貌信息
		 * 
		 * @param politicalStatusBO
		 * @return
		 */
		// public ConsoleReturnBO updatePoliticalStatus(PoliticalStatusBO
		// politicalStatusBO);

		returnBuffer.append("/**").append("\n");
		returnBuffer.append("* 更新").append(clazzBO.getEntityName()).append("信息").append("\n");
		returnBuffer.append("*").append("\n");
		returnBuffer.append("* @param ").append(clazzBO.getEntityCodeCamal()).append("BO").append("\n");
		returnBuffer.append("* @return").append("\n");
		returnBuffer.append("*/").append("\n");
		returnBuffer.append("public ConsoleReturnBO update").append(clazzBO.getEntityCode()).append("(").append(clazzBO.getEntityCode()).append("BO ").append(clazzBO.getEntityCodeCamal()).append("BO);").append("\n");

		/**
		 * 更新政治面貌信息列表
		 * 
		 * @param politicalStatusBOList
		 * @return
		 * @throws ConsoleRollBackException
		 */
		// public ConsoleReturnBO updatePoliticalStatus(List<PoliticalStatusBO>
		// politicalStatusBOList) throws ConsoleRollBackException;

		returnBuffer.append("/**").append("\n");
		returnBuffer.append("* 更新").append(clazzBO.getEntityName()).append("信息列表").append("\n");
		returnBuffer.append("*").append("\n");
		returnBuffer.append("* @param ").append(clazzBO.getEntityCodeCamal()).append("BOList").append("\n");
		returnBuffer.append("* @return").append("\n");
		returnBuffer.append("* @throws ConsoleException").append("\n");
		returnBuffer.append("*/").append("\n");
		returnBuffer.append("public ConsoleReturnBO update").append(clazzBO.getEntityCode()).append("(List<").append(clazzBO.getEntityCode()).append("BO> ").append(clazzBO.getEntityCodeCamal()).append("BOList) throws ConsoleException;").append("\n");

		/**
		 * 删除政治面貌信息
		 * 
		 * @param politicalStatusBO
		 * @return
		 */
		// public ConsoleReturnBO removePoliticalStatus(PoliticalStatusBO
		// politicalStatusBO);

		returnBuffer.append("/**").append("\n");
		returnBuffer.append("* 删除").append(clazzBO.getEntityName()).append("信息").append("\n");
		returnBuffer.append("*").append("\n");
		returnBuffer.append("* @param ").append(clazzBO.getEntityCodeCamal()).append("BO").append("\n");
		returnBuffer.append("* @return").append("\n");
		returnBuffer.append("*/").append("\n");
		returnBuffer.append("public ConsoleReturnBO remove").append(clazzBO.getEntityCode()).append("(").append(clazzBO.getEntityCode()).append("BO ").append(clazzBO.getEntityCodeCamal()).append("BO);").append("\n");

		/**
		 * 删除政治面貌信息列表
		 * 
		 * @param politicalStatusBOList
		 * @return
		 * @throws ConsoleRollBackException
		 */
		// public ConsoleReturnBO removePoliticalStatus(List<PoliticalStatusBO>
		// politicalStatusBOList) throws ConsoleRollBackException;

		returnBuffer.append("/**").append("\n");
		returnBuffer.append("* 删除").append(clazzBO.getEntityName()).append("信息列表").append("\n");
		returnBuffer.append("*").append("\n");
		returnBuffer.append("* @param ").append(clazzBO.getEntityCodeCamal()).append("BOList").append("\n");
		returnBuffer.append("* @return").append("\n");
		returnBuffer.append("* @throws ConsoleException").append("\n");
		returnBuffer.append("*/").append("\n");
		returnBuffer.append("public ConsoleReturnBO remove").append(clazzBO.getEntityCode()).append("(List<").append(clazzBO.getEntityCode()).append("BO> ").append(clazzBO.getEntityCodeCamal()).append("BOList) throws ConsoleException;").append("\n");

		/**
		 * 统计
		 * 
		 * @param politicalStatusBO
		 * @return
		 */
		// public Long count(PoliticalStatusBO politicalStatusBO);

		returnBuffer.append("/**").append("\n");
		returnBuffer.append("* 统计").append(clazzBO.getEntityName()).append("信息").append("\n");
		returnBuffer.append("*").append("\n");
		returnBuffer.append("* @param ").append(clazzBO.getEntityCodeCamal()).append("BO").append("\n");
		returnBuffer.append("* @return").append("\n");
		returnBuffer.append("*/").append("\n");
		returnBuffer.append("public Long count").append(clazzBO.getEntityCode()).append("(").append(clazzBO.getEntityCode()).append("BO ").append(clazzBO.getEntityCodeCamal()).append("BO);").append("\n");

		// returnBuffer.append("}").append("\n");

		return returnBuffer.toString();
	}

}
